import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
  UseGuards,
} from '@nestjs/common';
import { AuthsService } from './auths.service';
import { CreateAuthDto } from './dto/create-auth.dto';
import { UpdateAuthDto } from './dto/update-auth.dto';
import { UserInfo } from '../../common/user-info/user-info.dto';
import { AuthGuard } from '@nestjs/passport';
import { Public } from './public';

@Controller('auths')
export class AuthsController {
  constructor(private readonly authsService: AuthsService) {}

  @Public()
  @UseGuards(AuthGuard('local'))
  @Post('/login')
  login(@Body() userinfo: UserInfo) {
    return this.authsService.login(userinfo);
  }
}
